package domain.entities;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Studystartup entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "studystartup", catalog = "bms")
public class Studystartup implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date dated;
	private String description;
	private Date receivedBms;

    public static final String CLASSTITLE = "Study Startup";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("description", "Description");
                            put("dated", "Date");
                            put("receivedBms", "Received at BMS");
                        }
                    }
            )
    );

    public static ArrayList<String> getDescriptions(){
        ArrayList<String> descripciones = new ArrayList<String>(0);
        descripciones.add("Commitment note from the investigator  to observe the protocol, the Declaration of Helsinki, and the ANMAT GCP-CPS Regulation");
        descripciones.add("Authenticated copies of professional degree");
        descripciones.add("Authenticated copies of professional license");
        descripciones.add("Authenticated copies of  certificates for training and/or experience in clinical research");
        descripciones.add("Authenticated copies of specialization degree or full residency certificate or postgraduate certificate in the specialization corresponding to the study disease, in the case of Phase II and III studies.");
        descripciones.add("Copy of current health license for the institution seat of the study");
        descripciones.add("Authenticated copy of the authorization letter from the site’s authority  ( requireb by ANMAT and Bs As Province  as Annex 4)");
        descripciones.add("Authenticated copy of the authorization letter from the site’s authority to have the study reviewed by an external EC, (for sites that does not have an IEC ) required by ANMAT and by Bs As Province)");
        descripciones.add("External EC: Monitoring Plan Plan  - could be part of the SOPs");
        descripciones.add("Plan de Monitoreo de comité de ética local- could be part of the SOPs");
        descripciones.add("External EC: Sworn Declaración signed by PI");
        descripciones.add("External EC (only for IEC Zieher): copy of the  authorization letter from the site’s authority to conducting the study and to  have the study reviewed by an external CE Zieher");
        descripciones.add("External EC ( only for IEC Zieher): letter from the sponsor when the PI and his staff do not have experience in clinical research");
        descripciones.add("Commitment note from the investigator to be presented to the CCIS (anexo 2)- site located in Bs As Province only");
        descripciones.add("Written commitment to provide treatment and compnsantion to the patient for related AEs  (anexo 3) site located in Bs As Province only");
        descripciones.add("Site located in Bs As Province only : Insurance certificate  for the site");
        descripciones.add("Site located in Bs As Province only : Copy of the  declaration of Helsinki version 2008 signed in all pages by the PI");
        descripciones.add("Site located in  Tucumán:  Confirmation of the communication date to SiProSa register.");
        descripciones.add("Sites in CABA (Private or Public) - sworn statement");
        descripciones.add("Site located in Santa Fe: certification of Register in the Comoté Provincial de BIOETICA");
        return descripciones;
    }


    // Constructors

	/** default constructor */
	public Studystartup() {
	}

	/** minimal constructor */
	public Studystartup(String description) {
        this.description = description;
	}

	/** full constructor */
	public Studystartup(ProtocoloCentro protocoloCentro, Date dated,
			String description, Date receivedBms) {
		this.protocoloCentro = protocoloCentro;
		this.dated = dated;
		this.description = description;
		this.receivedBms = receivedBms;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dated", length = 10)
	public Date getDated() {
		return this.dated;
	}

	public void setDated(Date dated) {
		this.dated = dated;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "receivedBMS", length = 10)
	public Date getReceivedBms() {
		return this.receivedBms;
	}

	public void setReceivedBms(Date receivedBms) {
		this.receivedBms = receivedBms;
	}

}